
function getSize(w,h){
	var areaSize=[];
	var wSize = $(window).width();
	var hSize = $(window).height();
	if(w > wSize){
		areaSize[0] = wSize-20;
	}else{
		areaSize[0] = w;
	}
	if(h > hSize){
		areaSize[1] = hSize-20;
	}else{
		areaSize[1] = h;
	}
	return areaSize;
}

function menuBar(){
	$.ajax({
		url:'/linkController/getChildrenList.do',
		async:false,
		dataType:'json',
		success:function(data){
			var list = data.data;
			var html="";
			for(var i=0;i<list.length;i++){
				html+='<a href="#"><i class="fa fa-home"></i> <span class="nav-label">'+list[i].urlName+'</span> ' +
					'<span class="fa arrow"></span></a>'+
					'<ul class="nav nav-second-level">';
				var chrList = list[i].children;
                for(var j=0;j<chrList.length;j++){
                	 html+='<li>' +
                	 '<a class="J_menuItem" href="'+chrList[j].url+'" data-index="0">'+chrList[j].urlName+'</a>' +
                	 '</li>';
                }   
                html+='</ul>'; 
			}
			$('#menu_id').append(html);
		},
		error:function(){
			layer.alert('菜单加载失败！请联系管理员', {icon: 6});
		}
	});
}